import request from '@/utils/request'

// 查询承包商管理分页
export function pageContractor(query) {
  return request({
    url: '/specialWork/contractor/page',
    method: 'get',
    params: query,
    factoryId: true
  })
}

// 查询承包商管理列表
export function listContractor(query) {
  return request({
    url: '/specialWork/contractor/list',
    method: 'get',
    params: query,
    factoryId: true
  })
}
export function resources(params) {
  return request({
    url: '/common/download/resource',
    method: 'get',
    responseType: 'blob',
    params,
    factoryId: true
  })
}
export function resources1(params) {
  return request({
    url: '/common/download/resource',
    method: 'get',
    responseType: 'arraybuffer',
    params,
    factoryId: true
  })
}
// 查询承包商管理详细
export function getContractor(id) {
  return request({
    url: '/specialWork/contractor/info/' + id,
    method: 'get',
    factoryId: true
  })
}

// 新增承包商管理
export function addContractor(data) {
  return request({
    url: '/specialWork/contractor',
    method: 'post',
    data: data,
    factoryId: true
  })
}

// 修改承包商管理
export function updateContractor(data) {
  return request({
    url: '/specialWork/contractor',
    method: 'put',
    data: data,
    factoryId: true
  })
}

// 删除承包商管理
export function delContractor(data) {
  return request({
    url: '/specialWork/contractor/remove/batch',
    method: 'delete',
    data,
    factoryId: true
  })
}

// 导出承包商管理
export function exportContractor(query) {
  return request({
    url: '/specialWork/contractor/export',
    method: 'get',
    params: query,
    factoryId: true
  })
}

// 下载模板承包商管理
export function downImportTemplate() {
  return request({
    url: '/specialWork/contractor/importTemplate',
    method: 'get',
    factoryId: true
  })
}
